package com.qf.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.qf.mapper.DtsAdminMapper;
import com.qf.pojo.DtsAdmin;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author Wy
 * @version V1.0
 * @Project MavenDemo
 * @Package com.qf.service
 * @Description:
 * @Date 2022/6/16 14:30
 */
@Service
public class AdminServiceImpl implements AdminService {

    @Autowired
    private DtsAdminMapper adminMapper;

    @Override
    public List<DtsAdmin> findAdminByUserName(String username) {
        //查询条件对象
        QueryWrapper objectQueryWrapper = new QueryWrapper();
        objectQueryWrapper.eq("username", username);
        objectQueryWrapper.eq("deleted", false);

        List list = adminMapper.selectList(objectQueryWrapper);
        return list;
    }

    @Override
    public List<DtsAdmin> findAdminByall() {
        QueryWrapper<DtsAdmin> objectQueryWrapper = new QueryWrapper<>();
        objectQueryWrapper.eq("deleted", false);
        List<DtsAdmin> dtsAdmins = adminMapper.selectList(objectQueryWrapper);
        return dtsAdmins;
    }
}
